<div class="sidebar_widget">
  <h3>Bài viết mới</h3>
  <ul class="recent_posts_list">

  <?php foreach ($articles as $a) {?>
  <li>
    <span>
      <a href="<?php echo Yii::app()->baseUrl?>/article/index/ID/<?php echo md5($a['id'])?>">
        <img
          src="<?php echo Yii::app()->baseUrl?>/images/post-simg1.jpg"
          alt="">
      </a> 
    </span>
    <a href="<?php echo Yii::app()->baseUrl?>/article/index/ID/<?php echo md5($a['id'])?>">
      <?php echo $a['title']?> 
     </a> 
     <i><?php echo date("d-m-Y G:i", $a['createddate'])?></i>
      
               <?php if($a['type']==1){?>
               
                 <a href="<?php echo Yii::app()->baseUrl?>/article/blog">
                 <?php echo "Bài viết" ?>
               
               <?php } else if($a['type']==2){?>
               
                 <a href="<?php echo Yii::app()->baseUrl?>/article/promotion">
                 <?php echo "Khuyến mãi" ?>
               
               <?php }else {?>
               
                 <a href="<?php echo Yii::app()->baseUrl?>/article/sample">
                 <?php echo "Công trình"?>
                 
               <?php }?>
            
            </a>
   </li>
  <?php }?>
  </ul>
</div>
